/*
	NPC Name: 		Agent Kitty
	Map(s): 		Special Training Camp for Agent (970030000)
	Description: 		Agent event Starter
*/

function start() {
   
	if (cm.getMapId() == 970030000) 
	{
		if(cm.getBossLog("每日二十七宫") <= 0)
		{
			cm.start_DojoAgent(false, false);
			cm.setBossLog("每日二十七宫");
			cm.dispose();
		}
		else if(cm.haveItem(4031274) && cm.getBossLog("每日二十七宫") <2)
		{
			cm.start_DojoAgent(false, false);
			cm.playerMessage(1,"VIP特权:每日可进入两次");
			cm.setBossLog("每日二十七宫");
			cm.dispose();
		}
		else
		{
			cm.playerMessage(1,"今天已经挑战过了,不能再挑战了");
			cm.dispose();
		}
    } 
	else 
	{
		cm.sendYesNo("你想出去?");
		type = 2;
    }
}

function action(mode, type, selection) {
    if (mode == 1) {
	cm.warp(970030000, 0);
    }
    cm.dispose();
}